package com.yf.dxapp.module.app.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@ConfigurationProperties(prefix = "wo")
@Data
public class WoProperties {

    public static String domain = "https://dopen.weimob.com/apigw";

    public String clientId;

    public String clientSecret;

    public String shopId;

    public String shopType;

    public String vid;

    public Long cardId;

    public Long adminWid;


    public List<WoLevel> levels;



    public Map<Long,String> toLevelMap(){
        return levels.stream().collect(Collectors.toMap(WoLevel::getLevelId,WoLevel::getLevelName));
    }

}
